import java.util.*;

public class Exercise {
    class Node{
        public Node key;
        public Node next;
        public Node(Node key, Node value){
            this.key = key;
        }
    }

    //坏键盘打字
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str1 = in.nextLine();
            String str2 = in.nextLine();
            Set<Character> set1 = new HashSet<>();
            for (char ch : str2.toUpperCase().toCharArray()) {
                set1.add(ch);
            }
            Set<Character> set2 = new HashSet<>();
            for (char ch : str1.toUpperCase().toCharArray()) {
                if (!set1.contains(ch) && !set2.contains(ch)) {
                    System.out.print(ch);
                    set2.add(ch);
                }
            }
        }
    }
    //宝石与石头
    public int numJewelsInStones(String jewels, String stones) {
        int count = 0;
        Set<Character> set = new HashSet<>();
        for(int i = 0; i < jewels.length(); i++){
            set.add(jewels.charAt(i));
        }
        for(int i = 0; i < stones.length(); i++){
            if(set.contains(stones.charAt(i))){
                count++;
            }
        }
        return count;
    }

    //复制复杂链表
    public Node copyRandomList(Node head) {
        Map<Node, Node> map = new HashMap<>();
        Node cur = head;
        //创建新老节点map
        while(cur != null){
            Node node = new Node(cur.val);
            map.put(cur,node);
            cur = cur.next;
        }
        cur = head;
        //将新老节点的next和random通过map进行对应
        while(cur != null){
            map.get(cur).next = map.get(cur.next);
            map.get(cur).random = map.get(cur.random);
            cur = cur.next;
        }
        return map.get(head);
    }
    //第一个只出现一次的字母
    public int singleNumber(int[] nums) {
        Set<Integer> set = new TreeSet<>();
        for(int i = 0; i < nums.length; i++){
            if(!set.contains(nums[i])){
                set.add(nums[i]);
            } else {
                set.remove(nums[i]);
            }
        }
        Object [] arr = set.toArray();
        return (int)arr[0];
    }
}
